// Copyright [2020] <unknown>
#include <bits/stdc++.h>
using namespace std;
// #define ONLINE_JUDGE
#ifndef ONLINE_JUDGE
#define dbg(x...) { cerr << "\033[32;1m" << #x << " -> "; err(x); }
void err() { cerr << "\033[39;0m" << endl; }
template<typename T, typename... A>
void err(T a, A... x) { cerr << a << ' '; err(x...); }
#else
#define dbg(...)
#endif

#define sz(x) ((int)x.size())

typedef long long LL;

const int N = 3e5+50;

const LL MOD = 998244353;




struct node {
    LL a, b, c;
    node(){}
    node(LL a, LL b, LL c):a(a), b(b), c(c){}
    node add(const node &other) const {
        LL a1 = a, b1 = b, c1 = c,
        a2 = other.a, b2 = other.b, c2 = other.c;
        return node(a1*(a2+b2+c2)%MOD, ((a1+b1)*((2*a2+b2+c2)%MOD)+b1*(a2+b2+c2)) % MOD, (c1*(a2+b2+c2) + (a2+b2)*(a1+c1))%MOD);
    }
} dp[N];

vector<int> G[N];
int n;

void dfs(int u, int fa) {
    dp[u] = node(1, 0, 0);
    for (int v : G[u]) {
        if (v == fa)
            continue;
        dfs(v, u);
        dp[u] = dp[u].add(dp[v]);
    }
}


int main(int argc, char const *argv[]) {
    // code
    scanf("%d", &n);
    for (int i=0; i<n-1; ++i) {
        int u, v;
        scanf("%d%d", &u, &v);
        G[u].push_back(v);
        G[v].push_back(u);
    }

    // for (int i=1; i<=n; ++i)
    //     dbg(i, dp[i].a, dp[i].b, dp[i].c);

    dfs(1, 1);
    printf("%lld\n", (dp[1].a+dp[1].b+dp[1].c-1)%MOD);
    return 0;
}
